<template>
  <div class="standard-view">
    <!-- 页面头部 -->
    <div class="page-header">
      <h1 class="page-title">
        <span class="icon">📏</span>
        设计规范
      </h1>
      <div class="breadcrumb">首页 / 系统信息 / 设计规范</div>
    </div>

    <!-- 主要内容区域 -->
    <div class="content-container">
      <!-- 规范说明卡片 -->
      <div class="intro-card">
        <div class="intro-icon">🏥</div>
        <h2 class="intro-title">医疗系统设计规范</h2>
        <p class="intro-text">
          本规范定义了区域慢病管理系统的设计标准，确保整个系统视觉风格统一、专业可信，
          为医护人员和患者提供清晰、易用的界面体验。规范涵盖配色方案、字体标准、组件样式等核心设计要素。
        </p>
      </div>

      <!-- 配色方案部分 -->
      <div class="section-card">
        <div class="section-header">
          <div class="section-icon">🎨</div>
          <h3 class="section-title">A. 配色方案</h3>
        </div>
        
        <div class="color-section">
          <h4 class="subsection-title">主色</h4>
          <div class="color-grid">
            <div class="color-item">
              <div class="color-swatch primary-main" style="background-color: #01337A;"></div>
              <div class="color-info">
                <div class="color-code">#01337A</div>
                <div class="color-name">深蓝主色</div>
                <div class="color-usage">主要按钮、标题、重要标识</div>
              </div>
            </div>
            
            <div class="color-item">
              <div class="color-swatch primary-secondary" style="background-color: #156296;"></div>
              <div class="color-info">
                <div class="color-code">#156296</div>
                <div class="color-name">中蓝主色</div>
                <div class="color-usage">次要按钮、高亮状态</div>
              </div>
            </div>
          </div>
        </div>

        <div class="color-section">
          <h4 class="subsection-title">辅助色</h4>
          <div class="color-grid">
            <div class="color-item">
              <div class="color-swatch success" style="background-color: #01A63E;"></div>
              <div class="color-info">
                <div class="color-code">#01A63E</div>
                <div class="color-name">成功绿</div>
                <div class="color-usage">成功状态、保存按钮、正常指标</div>
              </div>
            </div>
            
            <div class="color-item">
              <div class="color-swatch warning" style="background-color: #AA98BA;"></div>
              <div class="color-info">
                <div class="color-code">#AA98BA</div>
                <div class="color-name">提示紫</div>
                <div class="color-usage">提示信息、待处理状态</div>
              </div>
            </div>
            
            <div class="color-item">
              <div class="color-swatch danger" style="background-color: #462D92;"></div>
              <div class="color-info">
                <div class="color-code">#462D92</div>
                <div class="color-name">警示紫</div>
                <div class="color-usage">重要提示、异常警告</div>
              </div>
            </div>
          </div>
        </div>

        <div class="color-section">
          <h4 class="subsection-title">中性色</h4>
          <div class="color-grid">
            <div class="color-item">
              <div class="color-swatch text-primary" style="background-color: #333333;"></div>
              <div class="color-info">
                <div class="color-code">#333333</div>
                <div class="color-name">主要文字</div>
                <div class="color-usage">标题、重要文本</div>
              </div>
            </div>
            
            <div class="color-item">
              <div class="color-swatch text-secondary" style="background-color: #666666;"></div>
              <div class="color-info">
                <div class="color-code">#666666</div>
                <div class="color-name">次要文字</div>
                <div class="color-usage">说明文本、次要信息</div>
              </div>
            </div>
            
            <div class="color-item">
              <div class="color-swatch border" style="background-color: #999999;"></div>
              <div class="color-info">
                <div class="color-code">#999999</div>
                <div class="color-name">边框色</div>
                <div class="color-usage">边框、分隔线</div>
              </div>
            </div>
            
            <div class="color-item">
              <div class="color-swatch background" style="background-color: #F2F2F2;"></div>
              <div class="color-info">
                <div class="color-code">#F2F2F2</div>
                <div class="color-name">背景色</div>
                <div class="color-usage">页面背景、区块背景</div>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 字体规范部分 -->
      <div class="section-card">
        <div class="section-header">
          <div class="section-icon">📝</div>
          <h3 class="section-title">B. 字体规范</h3>
        </div>
        
        <div class="font-table">
          <table>
            <thead>
              <tr>
                <th>字号</th>
                <th>字重</th>
                <th>属性</th>
                <th>应用场景</th>
                <th>医疗示例</th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td class="font-size">18px</td>
                <td class="font-weight">Medium</td>
                <td class="font-attribute">大标题</td>
                <td class="font-usage">导航大标题</td>
                <td class="font-example"><span style="font-size: 18px; font-weight: 500;">患者管理中心</span></td>
              </tr>
              <tr>
                <td class="font-size">14px</td>
                <td class="font-weight">Medium</td>
                <td class="font-attribute">一级标题</td>
                <td class="font-usage">页面标题</td>
                <td class="font-example"><span style="font-size: 14px; font-weight: 500;">高血压患者随访记录</span></td>
              </tr>
              <tr>
                <td class="font-size">12px</td>
                <td class="font-weight">Regular</td>
                <td class="font-attribute">正文</td>
                <td class="font-usage">说明提示文本</td>
                <td class="font-example"><span style="font-size: 12px;">患者血压控制良好，建议继续当前治疗方案。</span></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>

      <!-- 按钮样式部分 -->
      <div class="section-card">
        <div class="section-header">
          <div class="section-icon">🔘</div>
          <h3 class="section-title">C. 按钮样式</h3>
        </div>
        
        <div class="button-section">
          <div class="button-item">
            <div class="button-preview">
              <button class="btn primary-btn">主按钮</button>
            </div>
            <div class="button-info">
              <div class="button-name">主按钮</div>
              <div class="button-usage">主要操作、提交表单</div>
              <div class="button-specs">
                <span>背景：#01337A</span>
                <span>文字：白色</span>
                <span>圆角：4px</span>
              </div>
            </div>
          </div>

          <div class="button-item">
            <div class="button-preview">
              <button class="btn secondary-btn">次按钮</button>
            </div>
            <div class="button-info">
              <div class="button-name">次按钮</div>
              <div class="button-usage">次要操作、取消</div>
              <div class="button-specs">
                <span>背景：#FFFFFF</span>
                <span>边框：#999999</span>
                <span>文字：#666666</span>
              </div>
            </div>
          </div>

          <div class="button-item">
            <div class="button-preview">
              <button class="btn success-btn">保存按钮</button>
            </div>
            <div class="button-info">
              <div class="button-name">保存按钮</div>
              <div class="button-usage">保存医疗记录、确认操作</div>
              <div class="button-specs">
                <span>背景：#01A63E</span>
                <span>文字：白色</span>
                <span>圆角：4px</span>
              </div>
            </div>
          </div>
        </div>
      </div>

      <!-- 医疗特有组件 -->
      <div class="section-card">
        <div class="section-header">
          <div class="section-icon">🏥</div>
          <h3 class="section-title">D. 医疗特有组件</h3>
        </div>
        
        <div class="medical-components">
          <!-- 指标卡片 -->
          <div class="component-item">
            <h4 class="component-title">指标卡片</h4>
            <div class="component-preview">
              <div class="medical-card normal">
                <div class="card-icon">💓</div>
                <div class="card-content">
                  <div class="card-title">血压</div>
                  <div class="card-value">120/80 mmHg</div>
                  <div class="card-status normal">正常范围</div>
                </div>
              </div>
              
              <div class="medical-card warning">
                <div class="card-icon">📊</div>
                <div class="card-content">
                  <div class="card-title">血糖</div>
                  <div class="card-value">7.8 mmol/L</div>
                  <div class="card-status warning">轻度偏高</div>
                </div>
              </div>
            </div>
            <div class="component-description">
              用于展示患者关键生理指标，根据数值范围显示不同颜色状态。
            </div>
          </div>

          <!-- 医疗标签 -->
          <div class="component-item">
            <h4 class="component-title">医疗标签</h4>
            <div class="component-preview">
              <div class="medical-tag primary">高血压</div>
              <div class="medical-tag secondary">糖尿病</div>
              <div class="medical-tag success">已控制</div>
              <div class="medical-tag warning">需随访</div>
              <div class="medical-tag danger">紧急</div>
            </div>
            <div class="component-description">
              用于标识患者疾病类型、治疗状态和优先级别的标签系统。
            </div>
          </div>

          <!-- 时间安排组件 -->
          <div class="component-item">
            <h4 class="component-title">随访日历</h4>
            <div class="component-preview">
              <div class="calendar-preview">
                <div class="calendar-header">
                  <span>5月随访安排</span>
                </div>
                <div class="calendar-dates">
                  <div class="date-item past">10</div>
                  <div class="date-item past">15</div>
                  <div class="date-item current">20</div>
                  <div class="date-item future">25</div>
                  <div class="date-item future">30</div>
                </div>
              </div>
            </div>
            <div class="component-description">
              用于展示和管理患者随访计划的时间安排组件。
            </div>
          </div>
        </div>
      </div>

      <!-- 空间规范部分 -->
      <div class="section-card">
        <div class="section-header">
          <div class="section-icon">📐</div>
          <h3 class="section-title">E. 空间规范</h3>
        </div>
        
        <div class="spacing-section">
          <div class="spacing-grid">
            <div class="spacing-item">
              <div class="spacing-preview" style="width: 8px; height: 8px;"></div>
              <div class="spacing-info">
                <div class="spacing-value">8px</div>
                <div class="spacing-usage">组件内部元素间距</div>
              </div>
            </div>
            
            <div class="spacing-item">
              <div class="spacing-preview" style="width: 16px; height: 16px;"></div>
              <div class="spacing-info">
                <div class="spacing-value">16px</div>
                <div class="spacing-usage">卡片内边距、组件间距</div>
              </div>
            </div>
            
            <div class="spacing-item">
              <div class="spacing-preview" style="width: 24px; height: 24px;"></div>
              <div class="spacing-info">
                <div class="spacing-value">24px</div>
                <div class="spacing-usage">区块间距、大组件间距</div>
              </div>
            </div>
            
            <div class="spacing-item">
              <div class="spacing-preview" style="width: 32px; height: 32px;"></div>
              <div class="spacing-info">
                <div class="spacing-value">32px</div>
                <div class="spacing-usage">页面边距、主要区域间距</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 底部信息 -->
    <div class="footer-section">
      <div class="footer-content">
        <div class="footer-logo">
          <i class="el-icon-medal"></i>
          <span>区域慢病管理系统 - 设计规范</span>
        </div>
        <div class="footer-info">
          <p>版本：V1.0</p>
          <p>© 2024 区域慢病管理系统 版权所有</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { ElMessage } from 'element-plus'

// 页面加载时的提示
onMounted(() => {
  ElMessage.info('查看区域慢病管理系统设计规范')
})
</script>

<style scoped>
/* 全局样式 */
.standard-view {
  padding: 20px;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  min-height: 100vh;
  font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 页面标题区域 */
.page-header {
  margin-bottom: 32px;
  padding: 24px 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

.page-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px 0;
  font-size: 32px;
  font-weight: 700;
  color: #01337A;
}

.page-title .icon {
  font-size: 36px;
}

.breadcrumb {
  font-size: 14px;
  color: #64748b;
  font-weight: 500;
}

/* 内容容器 */
.content-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* 介绍卡片 */
.intro-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.intro-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.intro-title {
  font-size: 28px;
  font-weight: 700;
  color: #01337A;
  margin-bottom: 16px;
}

.intro-text {
  font-size: 16px;
  line-height: 1.8;
  color: #334155;
  max-width: 900px;
  margin: 0 auto;
}

/* 通用区域卡片 */
.section-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e2e8f0;
}

.section-icon {
  font-size: 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: #01337A;
  margin: 0;
}

/* 配色方案样式 */
.color-section {
  margin-bottom: 32px;
}

.color-section:last-child {
  margin-bottom: 0;
}

.subsection-title {
  font-size: 18px;
  font-weight: 600;
  color: #01337A;
  margin-bottom: 16px;
}

.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.color-swatch {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  border: 2px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.color-info {
  flex: 1;
}

.color-code {
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: #01337A;
  margin-bottom: 4px;
}

.color-name {
  font-weight: 500;
  color: #334155;
  margin-bottom: 4px;
}

.color-usage {
  font-size: 14px;
  color: #64748b;
}

/* 字体规范样式 */
.font-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

th {
  background: #01337A;
  color: white;
  padding: 16px;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 16px;
  border-bottom: 1px solid #e2e8f0;
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) {
  background-color: #f8fafc;
}

.font-size,
.font-weight {
  font-family: 'Courier New', monospace;
}

.font-example {
  padding: 8px 16px;
  background: #f8fafc;
  border-radius: 8px;
}

/* 按钮样式部分 */
.button-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.button-item {
  display: flex;
  align-items: center;
  gap: 24px;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.button-preview {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 8px 24px;
  border-radius: 4px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.primary-btn {
  background: #01337A;
  color: white;
}

.primary-btn:hover {
  background: #012a5f;
}

.secondary-btn {
  background: white;
  color: #666666;
  border: 1px solid #999999;
}

.secondary-btn:hover {
  border-color: #666666;
  color: #333333;
}

.success-btn {
  background: #01A63E;
  color: white;
}

.success-btn:hover {
  background: #018a34;
}

.button-info {
  flex: 1;
}

.button-name {
  font-weight: 600;
  color: #01337A;
  margin-bottom: 4px;
}

.button-usage {
  color: #64748b;
  margin-bottom: 8px;
  font-size: 14px;
}

.button-specs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.button-specs span {
  font-size: 12px;
  color: #94a3b8;
  background: #f8fafc;
  padding: 4px 12px;
  border-radius: 4px;
}

/* 医疗特有组件样式 */
.medical-components {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.component-item {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.component-title {
  font-size: 18px;
  font-weight: 600;
  color: #01337A;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.component-preview {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.component-description {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
}

/* 医疗卡片样式 */
.medical-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: 12px;
  min-width: 220px;
  border: 1px solid #e2e8f0;
}

.medical-card.normal {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

.medical-card.warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-color: #fcd34d;
}

.card-icon {
  font-size: 32px;
}

.card-content {
  flex: 1;
}

.card-title {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 4px;
}

.card-value {
  font-size: 20px;
  font-weight: 700;
  color: #01337A;
  margin-bottom: 4px;
}

.card-status {
  font-size: 12px;
  font-weight: 500;
}

.card-status.normal {
  color: #01A63E;
}

.card-status.warning {
  color: #b45309;
}

/* 医疗标签样式 */
.medical-tag {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.medical-tag.primary {
  background: #dbeafe;
  color: #1d4ed8;
}

.medical-tag.secondary {
  background: #ede9fe;
  color: #6d28d9;
}

.medical-tag.success {
  background: #dcfce7;
  color: #166534;
}

.medical-tag.warning {
  background: #fef3c7;
  color: #b45309;
}

.medical-tag.danger {
  background: #fee2e2;
  color: #991b1b;
}

/* 日历预览样式 */
.calendar-preview {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  min-width: 280px;
}

.calendar-header {
  text-align: center;
  font-weight: 600;
  color: #01337A;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
}

.calendar-dates {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.date-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 500;
}

.date-item.past {
  background: #f1f5f9;
  color: #94a3b8;
}

.date-item.current {
  background: #01337A;
  color: white;
  box-shadow: 0 4px 12px rgba(1, 51, 122, 0.3);
}

.date-item.future {
  background: #e0f2fe;
  color: #0284c7;
}

/* 空间规范样式 */
.spacing-section {
  margin-bottom: 0;
}

.spacing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.spacing-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.spacing-preview {
  background: linear-gradient(135deg, #01337A, #156296);
  border-radius: 4px;
}

.spacing-info {
  flex: 1;
}

.spacing-value {
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: #01337A;
  margin-bottom: 4px;
}

.spacing-usage {
  font-size: 14px;
  color: #64748b;
}

/* 底部样式 */
.footer-section {
  margin-top: 64px;
  padding: 32px;
  background: linear-gradient(135deg, #01337A, #156296);
  border-radius: 16px;
  color: white;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
}

.footer-logo i {
  font-size: 32px;
}

.footer-info p {
  margin: 4px 0;
  font-size: 14px;
  opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .standard-view {
    padding: 16px;
  }
  
  .page-header {
    padding: 20px 24px;
    margin-bottom: 24px;
  }
  
  .page-title {
    font-size: 28px;
  }
  
  .section-card {
    padding: 24px;
    margin-bottom: 24px;
  }
  
  .color-grid,
  .spacing-grid {
    grid-template-columns: 1fr;
  }
  
  .button-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .component-preview {
    flex-direction: column;
    gap: 12px;
  }
  
  .medical-card {
    width: 100%;
    min-width: unset;
  }
  
  .calendar-preview {
    width: 100%;
  }
  
  .footer-section {
    padding: 24px;
  }
}
</style>